package nc;

import java.util.Scanner;

public class Qzbyd {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        if (scanner.hasNextLine()) {
            String nextLine = scanner.nextLine();
            String[] split = nextLine.split(";");
            int x = 0;
            int y = 0;
            for (String s : split) {
                if (s.matches("[ASWD]\\d{1,2}")) {
                    if (s.startsWith("A")) {
                        int moveX = -1 * Integer.parseInt(s.substring(1));
                        x += moveX;
                    }
                    if (s.startsWith("D")) {
                        int moveX = Integer.parseInt(s.substring(1));
                        x += moveX;
                    }
                    if (s.startsWith("W")) {
                        int moveY = Integer.parseInt(s.substring(1));
                        y += moveY;
                    }
                    if (s.startsWith("S")) {
                        int moveY = Integer.parseInt(s.substring(1));
                        y -= moveY;
                    }
                }
            }
            System.out.println("(" + x + ","+y+")");
        }
    }

}
